package cn.iocoder.yudao.module.erp.controller.admin.saleorder.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 销售单和物品的链接表-多对多关系（针对复制功能，不需要id和订单id） Response VO")
@Data
@ExcelIgnoreUnannotated
public class SaleOrderGoodsNoIdRespVO {

    @Schema(description = "物品id")
    private Long goodsId;

    @Schema(description = "订单id")
    private Long orderId;

//    @Schema(description = "仓库id")
//    private Long warehouseId;

    @Schema(description = "物品编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("物品编号")
    private String code;

    @Schema(description = "物品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    @ExcelProperty("物品名称")
    private String name;

    @Schema(description = "物品规格型号")
    @ExcelProperty("物品规格型号")
    private String models;

    @Schema(description = "英文名称")
    @ExcelProperty("英文名称")
    private String nameEn;

    @Schema(description = "条码")
    @ExcelProperty("条形码")
    private String proBarCode;

    @Schema(description = "单位")
    @ExcelProperty("单位")
    private String unit;

    @Schema(description = "品牌")
    @ExcelProperty("品牌")
    private String brand;

    @Schema(description = "制造商型号")
    @ExcelProperty("制造商型号")
    private String produceModel;

    @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("数量")
    private BigDecimal number;

    @Schema(description = "税率")
    @ExcelProperty("税率")
    private BigDecimal taxRate;

    @Schema(description = "未税单价", example = "12084")
    @ExcelProperty("未税单价")
    private BigDecimal noTaxPrice;

    @Schema(description = "未税总额")
    @ExcelProperty("未税总额")
    private BigDecimal noTaxTotal;

    @Schema(description = "税额")
    @ExcelProperty("税额")
    private BigDecimal tax;

    @Schema(description = "单价", example = "26750")
    @ExcelProperty("单价")
    private BigDecimal price;

    @Schema(description = "价税总额")
    @ExcelProperty("价税总额")
    private BigDecimal total;

    @Schema(description = "单位成本")
    @ExcelProperty("单位成本")
    private BigDecimal unitCost;

    @Schema(description = "交付日期")
    @ExcelProperty("交付日期")
    private LocalDateTime deliveryData;

    @Schema(description = "出库数量")
    @ExcelProperty("出库数量")
    private BigDecimal outNum;

    @Schema(description = "退货数量")
    @ExcelProperty("退货数量")
    private BigDecimal inNum;

    @Schema(description = "未出库数量")
    @ExcelProperty("未出库数量")
    private BigDecimal noOutNum;

    @Schema(description = "计划生产数量")
    @ExcelProperty("计划生产数量")
    private BigDecimal planNum;

    @Schema(description = "排产数量")
    @ExcelProperty("排产数量")
    private BigDecimal workNum;

    @Schema(description = "备注")
    @ExcelProperty("备注")
    private String remarks;

    @Schema(description = "添加时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("添加时间")
    private LocalDateTime createTime;

    @Schema(description = "库存列表")
    private List<SaleOrderGoodsRespVO.InventoryItem> inventoryList;

    private BigDecimal inventoryTotal;

    @Data
    public static class InventoryItem {
        private Long warehouseId;
        private String warehouseName;
        private BigDecimal inventory;
    }

}